package com.ewanghuiju.app.ui.pintuan.adapter;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ewanghuiju.app.R;
import com.makeramen.roundedimageview.RoundedImageView;

/**
 * @author sj  qq:751943509
 * @class 拼团头像列表
 * @time 2020/2/20
 */
public class PintuanheadListAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    public PintuanheadListAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        RoundedImageView roundedImageView = helper.getView(R.id.riv_user_head);
        if (helper.getLayoutPosition() == 0) {
            helper.setVisible(R.id.tv_group_lead, true);
        } else {
            helper.setVisible(R.id.tv_group_lead, false);
        }
        if (!"NO_DATA".equals(item)) {
//            ImageLoader.load(mContext, item, roundedImageView);
            Glide.with(mContext).load(item).placeholder(R.mipmap.icon_tuan_head_normal).error(R.mipmap.icon_tuan_head_normal).into(roundedImageView);
        }
    }
}
